All Functions Used on the Module

prop.table

{base}

Transform frequency table into table of proportions

filter

{dplyr}

Filter out rows of a data frame according to logical vector

plot

{graphics}

Generic function from base R to produce a plot

rbeta

{stats}

Beta Random Number Generating Function

summary

{base}

Obtain summary statistics or detailed regression output

scale_colour_manual

{GGPLOT2}

Create your own discrete scale

after_stat

{GGPLOT2}

Control aesthetic evaluation. On the module used for displying percent

desc

{dplyr}

Arrange in descending order

contrasts

{stats}

Get and Set Contrast Matrices (find reference category)

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

class

{base}

Retrieve class of an R object

range

{base}

Return range of values

factor

{base}

Create a factor

round

{base}

Rounds numbers

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

var

{stats}

Calculate variance

tabulate

{base}

Counts the number of times each integer occurs in an integer-only vector

element_text

{GGPLOT2}

Customise text in GGPLOT2

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

is.na

{base}

Check if a value is NA/elements of vector are NA

ungroup

{dplyr}

Resolve grouping created with “group_by”

select

{dplyr}

Select columns from a tibble/data frame

reorder

{stats}

Reorder Levels of Factor based on the values of a second variable, usually numeric.

seq

{base}

Create a sequence

unique

{base}

get unique elements

install.packages

{base}

Install R package

max

{base}

Get maximum of a vector

read_dta

{haven}

Read a .dta file (Stata data)

cut

{base}

Convert Numeric to Factor

str

{utils}

Get the structure of an R object

geom_vline

{GGPLOT2}

Draws a vertical line

cor

{stats}

Calculate Correlation Matrix

prop.test

{stats}

Test of Equal or Given Proportions

rbind

{base}

Combine R objects by rows

geom_point

{GGPLOT2}

Generates a scatter plot

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

relevel

{stats}

Reorder Levels of Factor

labs

{GGPLOT2}

Customise labels in GGPLOT2

as.numeric

{base}

Coerce a vector to numeric

tapply

{base}

Create statistical summaries by group based on the levels of one or several factors

sum

{base}

Get sum of numeric values or a vector

matrix

{base}

Creates a matrix from the given set of values.

coord_flip

{GGPLOT2}

Flip the x and y axes of a graph

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

head

{utils}

Show first 5 rows of a data frame

which.max

{base}

return index of the largest value in a vector

which

{base}

return indexes of TRUE entries of a logical vector

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

geom_histogram

{GGPLOT2}

Generates a histogram

theme

{GGPLOT2}

Set theme for GGPLOT2

library

{base}

Load an R package

hist

{graphics}

Plot a simple histogram

complete.cases

{stats}

Find Complete Cases

quantile

{stats}

Obtain empirical quantiles of a vector

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

lm

{base}

Fit a linear model

recode

{dplyr}

Recode a variable

slice

{dplyr}

Subset rows using their positions

is.element

{base}

Check if a value is element of a vector

rnorm

{base}

Generate random numbers from a normal distribution

get_mode

{rstatix}

Compute the mode in a given vector.

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

set.seed

{base}

Initialise a pseudorandom number generator.

data.frame

{base}

Create a data.frame from vectors

confint

{stats}

Calculate confidence Intervals for Model Parameters

predict

{stats}

Predict Probability

ordered

{dplyr}

Create an ordered factor

pie

{graphics}

Creates a basic pie chart

xlab

{GGPLOT2}

Label the x axis (ggplot)

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

theme_bw

{GGPLOT2}

A black and white ggplot theme

ifelse

{base}

Return a or b depending on the value of test

sample_n

{dplyr}

Sample a number of observations from a data frame

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

lprop

{questionr}

Display row percentages of a two-way frequency table

ylab

{GGPLOT2}

Label the y axis (ggplot)

names

{base}

Retrieve names of a list/vector

print

{base}

Print object to the console

dim

{base}

Get dimensions of a data frame

log

{base}

log (default base = e)

ncol

{base}

Get number of columns of a data frame

barplot

{graphics}

Plot a simple bar plot

read_excel

{readxl}

Read an Excel file

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

c

{base}

Combine values/vectors into a vector

colnames

{base}

Retrieve column names of a data frame

dnorm

{stats}

Density distribution for the normal distribution

setwd

{base}

Set Working Directory

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

mutate

{dplyr}

Modify/create a column in a data frame

grid.arrange

{gridExtra}

Places graphical objects into a rectangular grid

stargazer

{stargazer}

Create a regression output table

boxplot

{graphics}

Plot a simple box plot

attach

{base}

Attach Set of R Objects to Search Path

mean

{base}

Get mean of a vector

droplevels

{base}

Drop Unused Levels from Factors

order

{base}

Get indexes that will sort a vector

cbind

{base}

Combine R objects by columns

View

{base}

View a data frame

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

expression

{base}

Used in plots to add symbols to axes

median

{stats}

Get median of a vector

geom_segment

{GGPLOT2}

Generates a line segment or curve

cor.test

{stats}

Test for Association/Correlation Between Paired Samples

freq

{questionr}

Generate frequency tables

sample

{base}

Takes a sample of the specified size

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

read.spss

{foreign}

Read a .sav file (SPSS data)

sd

{stats}

Get standard deviation of a vector

geom_ribbon

{GGPLOT2}

Generates an area plot

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

with

{base}

evaluate expression in the context of a data frame

min

{base}

Get minimum of a vector

nrow

{base}

Get number of rows of a data frame

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

geom_bar

{GGPLOT2}

Generates a bar chart

levels

{base}

Get levels of a factor

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

plotPlane

{rockchalk}

Draw a 3-D regression plot for two predictors

addmargins

{stats}

Puts Arbitrary Margins on Multidimensional Tables or Arrays

runif

{stats}

Draws ranndom numbers from the uniform distribution

arrow

{GGPLOT2}

Draw an arrow in a ggplot graph

par

{graphics}

Set parameters of the plotting device

rm

{base}

Remove objects

geom_density

{GGPLOT2}

Generates a density plot

ggplot

{GGPLOT2}

Create a ggplot graph

as.factor

{base}

Coerce a vector to factor

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

The end!